package com.pilipili.service;

import com.pilipili.dao.BookMapper;
import com.pilipili.pojo.Books;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("BookServiceImpl")
public class BookServiceImpl implements BookService{

    @Autowired
    @Qualifier("bookMapper")
    private BookMapper bookMapper;
    @Override
    public List<Books> selectAllBook() {
       return bookMapper.selectAllBook();
    }

    @Override
    public List<Books> selectBook(Books books) {

        return bookMapper.selectBook(books);
    }

    @Override
    public int insertBook(Books books) {
        return bookMapper.insertBook(books);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public int deleteBook(int bookID) {
        return bookMapper.deleteBook(bookID);
    }

    @Override
    public int selectBookCount(String type) {
        return bookMapper.selectBookCount(type);
    }
}
